package tt.dz.egobus.servicemanager.business.convert;

import org.springframework.core.convert.converter.Converter;
import tt.dz.egobus.servicemanager.entities.BusService;

/**
 * @author Anson
 * @date 17-9-1
 * @name 服务说明转换
 * @since 1.0.7
 */
public class BusinessRemarkConverter implements Converter<BusService, String> {

    private static final String SERVICE_REMARK = "%s基本费用%s元,可用时长%s分钟,超过时长之后每%s分钟%s元";

    @Override
    public String convert(BusService service) {
        return String.format(SERVICE_REMARK, service.getName(),
                service.getBasicsCost() + "", service.getTimeLimit() + "", service.getTimeUnit() + "",
                service.getPriceUnit() + "");
    }
}
